import Mock from 'mockjs';
import classify from './classify.json';
import list from './list.json';

Mock.mock('/api/classify','get',() => {
    return classify
})
Mock.mock('/api/list',(req:any) => {
    console.log(req)
    let {id} = JSON.parse(req.body);

    let target = list.filter(item => item.parent == id);
    return target
})
//获取详情
Mock.mock('/api/detail',(req:any) => {
    let {id} = JSON.parse(req.body);
    let detail = list.find(item => item.id == id);
    return detail
})